// 路由守卫组件
import MainLayout from "@/layout";
import { RootState } from "@/store";
import * as React from "react";
import { useSelector } from "react-redux";
import { Navigate } from "react-router-dom";
export interface IAuthRequiredProps {}

export default function AuthRequired(props: IAuthRequiredProps) {
  let { user } = useSelector((state: RootState) => state);
  return <>{user.isLogin ? <MainLayout /> : <Navigate to="/login" />}</>;
}
